package spring6_learn;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        /**
         * /*拦截一级路径  如/login ,/regist
         * /**任意级路径，如/login /regist/add /login/add/1
         * /login/*拦截login下的一级路径
          * @return
          **/
        registry.addInterceptor(new InterceptorTest()).addPathPatterns("/**");

    }
}
